<?php

class Registration_m extends CI_Model {


	function save_new(){
		
		$confirm = $this->save_user();
		
		if($confirm){
			
			return true;
		}
		else{
		
		return false; // means password is not match..
		
		}
		
		
	}
	function save_user(){
		
		if( $this->input->post('password') == $this->input->post('cpassword') && filter_var($this->input->post('email'), FILTER_VALIDATE_EMAIL) ){		
			$data = array(
				'email' => $this->input->post('email'),
				'password' => $this->input->post('password'),
			);
			
			$res = $this->db->insert('clients',$data);
			
			return true;
		}
		else{
			return false;
		}
	}

}// end registration model..